package com.example.borui.partpositionproject.simple.factory;

import android.content.Context;

import com.example.borui.partpositionproject.partpisition.base.BasePartPosition;
import com.example.borui.partpositionproject.partpisition.base.IPartPositionView;
import com.example.borui.partpositionproject.partpisition.view.IPartPositionBean;
import com.example.borui.partpositionproject.simple.partposition.five.FivePartPosition;
import com.example.borui.partpositionproject.simple.partposition.four.FourPartPosition;
import com.example.borui.partpositionproject.simple.partposition.one.OnePartPosition;
import com.example.borui.partpositionproject.simple.partposition.three.ThreePartPosition;
import com.example.borui.partpositionproject.simple.partposition.two.TwoPartPosition;

/**
 * Created by borui on 2017/9/29.
 */

public class PartPositionFactory {

    public static BasePartPosition builtBasePartPosition(Context mContext, int partPosition, IPartPositionBean bean, IPartPositionView view) {
        switch (bean.getPartPositionType()) {
            case 1:
                return new OnePartPosition(mContext, 1, partPosition, view);
            case 2:
                return new TwoPartPosition(mContext, 2, partPosition, view);
            case 3:
                return new ThreePartPosition(mContext, 3, partPosition, view);
            case 4:
                return new FourPartPosition(mContext, 4, partPosition, view);
            case 5:
                return new FivePartPosition(mContext, 5, partPosition, view);
            default:
                return new OnePartPosition(mContext, 1, partPosition, view);
        }
    }
}
